﻿using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Text;

namespace BOSS.Framework.Search.Context
{
    /// <summary>
    /// 搜索上下文解析器
    /// </summary>
    public interface ISearchContextParser
    {
        /// <summary>
        /// 从 URL 中解析得到一个搜索上下文
        /// </summary>
        /// <param name="url"></param>
        /// <returns></returns>
        ISearchContext Parse(string url);

        /// <summary>
        /// 从 URL 中解析得到一个搜索上下文
        /// </summary>
        /// <param name="url"></param>
        /// <param name="oneSortOnly"></param>
        /// <returns></returns>
        ISearchContext Parse(string url, bool oneSortOnly);

        /// <summary>
        /// 解析参数集合得到一个搜索上下文
        /// </summary>
        /// <param name="parameters"></param>
        /// <returns></returns>
        ISearchContext Parse(NameValueCollection parameters);

        /// <summary>
        /// 解析参数集合得到一个搜索上下文
        /// </summary>
        /// <param name="parameters"></param>
        /// <param name="oneSortOnly"></param>
        /// <returns></returns>
        ISearchContext Parse(NameValueCollection parameters, bool oneSortOnly);
    }
}
